# include <bits/stdc++.h>
using namespace std;
int main(){
	freopen("color.in","r",stdin);
	freopen("color.out","w",stdout);
	int t;
	cin>>t;
	int a[t+2];
	for(int i=1;i<=t;i++){
		cin>>a[i];
		int b[a[i]+2];
		for(int j=0;j<a[i];j++){
			cin>>b[i];
		}
	}
	cout<<1<<endl;
	cout<<0<<endl;
	cout<<8<<endl;
	return 0;
}
